<?
include("gestione/includes/config.inc.php");
include("gestione/includes/auth.lib.php");
include("gestione/includes/function.inc.php");
include("gestione/includes/product_new.class.php");
include("gestione/includes/e-commerce_new.class.php");
include("gestione/includes/news.class.php");
include("gestione/includes/content.class.php");
include("gestione/includes/keywords.class.php");
include("gestione/includes/class.xml.php");
$lang = "ita";
$cid = $_GET['cid'];
if($cid=="")
  $cid = 733;
####################### SESSION ##############################################################
$newSession = new websession();
$strNumArt = '<strong>non ci sono articoli</strong>';
$str_tot = 0;
if($newSession->order != NULL) {
	$articoli = $newSession->order->getArticoli();
	$numArt = count($articoli);
	$tot = $newSession->order->getTotale($articoli);
	$tot=="" ? $str_tot = 0 : $str_tot = number_format($tot,2,",",".");
	if($numArt>0) {
		$numArt>1 ?
		$strNumArt = '<strong>'.$numArt.' prodotti</strong>' : 
		$strNumArt = '<strong>'.$numArt.' prodotto</strong>';
	} else 
		$strNumArt = '<strong>non ci sono articoli</strong>';
}
$strNumArt .= '<br><strong>TOTALE: '.$str_tot.'</strong>';
if($newSession->getStatus())  {
	$registrati = '<div class="col_lft_tit">ACCOUNT</div>
	<div class="col_lft_main"><a href="/webproduct.php?op=profile" title="Il tuo Profilo"><img src="/immagini/freccia.png" width="9" height="8" /><blockquote>Il tuo Profilo</blockquote></a>
	<a href="/webproduct.php?op=logout"><img src="/immagini/freccia.png" width="9" height="8" /><blockquote>Log out</blockquote></a>
	</div>';
	$tablelogin = '';
} else {
	$registrati = '<div class="col_lft_tit">REGISTRATI</div>
<div class="col_lft_main"><a href="/webproduct.php?op=register"><img src="/immagini/freccia.png" width="9" height="8" /><blockquote>Login</blockquote></a>
</div>';
}
################################ indicizzazione #####################################################
	 $newContent = new content(37);
	 $tagtitle = $newContent->tagtitle;
	 $tagkey = $newContent->tagkey;
	 $tagdesc = $newContent->tagdesc;
	 $metatitle = $newContent->metatitle;
	 $metakey = $newContent->metakey;
	 $metadesc = $newContent->metadesc;
	 $hidden = $newContent->hidden; 
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xml:lang="it" xmlns="http://www.w3.org/1999/xhtml"><head>
<? include("includes/header.php") ?>
</head>
<body>
<div class="content">
<? include("includes/top.php")?>
<div class="main">
<? include("includes/left.php")?>
<div class="col_dx">
<?php 
//error_reporting(E_ALL);
	   $doc = new DOMDocument();
	   $doc->load( 'http://mrpiscina.bsvillage.com/getXmlBanner.php' );
	   $imgs = $doc->getElementsByTagName( "imgSlider" );
	   if ($imgs->length > 0) {
	   ?>
       <div id="slider-wrapper" style="float:left;margin-bottom:50px;">
            <div id="slider" class="nivoSlider">
               <?php
                $listimages = "";			
                foreach( $imgs as $img ) {
                    $tagssrc = $img->getElementsByTagName( "src" );
                    $tagsrc = $tagssrc->item(0)->nodeValue;
                  
                    $tagstext = $img->getElementsByTagName( "text" );
                    $tagtext = str_replace("euro","&euro;",$tagstext->item(0)->nodeValue);
                  
                    $tagshref = $img->getElementsByTagName( "href" );
                    $taghref = $tagshref->item(0)->nodeValue;
                  
                    $listimages .= (!empty($taghref)?'<a href="'.$taghref.'">':'').'<img src="'.$tagsrc.'" title="'.utf8_decode($tagtext).'">'.(!empty($taghref)?'</a>':'')."\n";
                }
                echo $listimages;
                ?>
            </div>        
       </div>
       <? } ?>
<?=articoli::getNovitaHome($cid,$lang);?>
<div class="chiudi"></div>
</div>
<div class="chiudi"></div>
<? include("includes/footer.php")?>
</div>
</div>
</body>
</html>